#include "SMPPPayloadType.hpp"

using namespace smpp::pdu;

PayloadType::PayloadType(const quint8 nValue):
TLV(TLVtags::TAG_PAYLOAD_TYPE,1),_Value(nValue){}

PayloadType::PayloadType(const PayloadType &nPayloadType):
TLV(nPayloadType),_Value(nPayloadType.getValue()){}

bool PayloadType::operator ==(const PayloadType &nPayloadType) const{
	return (TLV::operator == (nPayloadType) && 
			_Value == nPayloadType.getValue());
}

bool PayloadType::operator !=(const PayloadType &nPayloadType) const{
	return !this->operator == (nPayloadType);
}

PayloadType &PayloadType::operator = (const PayloadType &nPayloadType){
	if(*this == nPayloadType)
		return *this;
	TLV::operator = (nPayloadType);
	_Value = nPayloadType.getValue();
	return *this;
}

void PayloadType::setValue(const quint8 nValue){
	_Value = nValue;
}

const quint8 PayloadType::getValue() const{
	return _Value;
}
